<template>
	<view :class="myClass">
		{{text}}
	</view>
</template>

<script>
	export default {
		name:"color-text",
		props:{
			text : String ,
		},
		computed:{
			myClass(){
				switch (this.text){
					case "正常":
						return "green" 
					case "故障":
						return "red" 
					case "无":
						return "yellow" 
					default:
						return ""
				}
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style>

</style>
